<?php
error_reporting(0);
include ('common/connection.php');
$queryUser="SELECT max(id) as id FROM `users`";
$resultUser=mysql_db_query($db_name,$queryUser);
$rsUser=mysql_fetch_array($resultUser);

$group=$_REQUEST['group'];
$batch=$_REQUEST['batch'];
$gender=$_REQUEST['gender'];
$full_name=$_REQUEST['full_name'];
$nick_name=$_REQUEST['nick_name'];
$cell_phone=$_REQUEST['cell_phone'];
$cell_phone1=$_REQUEST['cell_phone1'];
$email=$_REQUEST['email'];
$address=$_REQUEST['address'];
$amount=$_REQUEST['amount'];
$spouse=$_REQUEST['spouse'];
function generateRandomNumber($ranLength)
{
	$random_id_length = $ranLength; 
	$rnd_id = uniqid(rand(),1); 
	//$rnd_id = md5(uniqid(rand(), true));
	//$rnd_id = strip_tags(stripslashes($rnd_id)); 
	//$rnd_id = str_replace(".","",$rnd_id); 
	$rnd_id = strrev(str_replace("/","",$rnd_id)); 
	$rnd_id = substr($rnd_id,0,$random_id_length);	
	return $rnd_id;
}
$GenerateOrderId=generateRandomNumber("4");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" href="formStyle.css" type="text/css" />
<link rel="stylesheet" href="validate/validationEngine.jquery.css" type="text/css"/>
<!--<script src="biswajit_countdown.js" type="text/javascript"></script>
<script type="text/javascript">window.onload=function(){ GetCount(dateFuture1, 'counter');};</script>-->
<title>Home</title>
<script src="validate/jquery-1.6.min.js" type="text/javascript">
</script>
<script src="validate/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8">
</script>
<script src="validate/jquery.validationEngine.js" type="text/javascript" charset="utf-8">
</script>
<script>
	jQuery(document).ready( function() {
		// binds form submission and fields to the validation engine
		jQuery("#formID").validationEngine();
	});
</script>
<script language="javascript" type="text/javascript">

function getXMLHTTP() { //fuction to return the xml http object
		var xmlhttp=false;	
		try{
			xmlhttp=new XMLHttpRequest();
		}
		catch(e)	{		
			try{			
				xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){
				try{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }
	
	function getBatch(groupId) {		
		
		var strURL="findState.php?group="+groupId;
		var req = getXMLHTTP();
		
		if (req) {
			
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					// only if "OK"
					if (req.status == 200) {						
						document.getElementById('statediv').innerHTML=req.responseText;						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}		
	}
	
	function AjaxFunction(email)
	{
		//alert(email);
		var url="validation.php";
		url=url+"?email="+email;
		url=url+"&sid="+Math.random();
		var reqEmqil = getXMLHTTP();
		
		if (reqEmqil) {
			
			reqEmqil.onreadystatechange = function() {
				if (reqEmqil.readyState == 4) {
					// only if "OK"
										
						document.getElementById("msg").innerHTML=reqEmqil.responseText;						
					
				}				
			}			
			reqEmqil.open("GET", url, true);
			reqEmqil.send(null);
		}
	 
	}
	
</script>

</head>



<body>
<div id="main_div">
	<div id="main_div_upper_shadow"></div><!-- end of main_div_upper_shadow-->
    <div id="main_div_upper_black"></div><!-- end of main_div_upper_black-->
    
    <div id="main_div_banner_top">
    	<div id="logo"></div><!-- end of logo -->
    	<div id="header1"></div><!-- end of header1-->
        <div id="slogan"><p>45 years of togetherness</p></div><!-- end of slogan -->
        <div id="blinking_info"><p>NO SPOT REGISTRATION WILL BE AVAILABLE</p></div><!-- end of blinking_info -->
    </div><!-- end of main_div_banner_top-->
    
    <div id="middle_black_body">
    	<div id="counter"></div>
    
    
    	<table border="0" cellpadding="0" cellspacing="0">
        	<tr style="color:#FF4B00; font-weight:bold;">
            	<td><p>Date</p></td>
                <td><p>Venue</p></td>
                <td><p>Time</p></td>
            </tr>
            <tr style="color:#FFF">
            	<td><p>27 January, 2012</p></td>
                <td><p>Bangabandhu International Conference Centre</p></td>
                <td><p>3pm - 11pm</p></td>
            </tr>
        </table>
    </div><!-- end of middle_black_body -->
    
    <div id="after_middle_black_body">
   		<div id="after_middle_curvy_top"></div>
        <div id="after_middle_normal_body">
        	<p class="header_p1">Online Registration Form</p>
            <p class="header_p2">Last date submisson 20 January, 2012</p>
            
            <div class="container">
                <form  id="formID" class="formular" name="regis" action="preview.php" method="post">
                    <table cellspacing="20" cellpadding="10">
                        <tr>
                            <td> Group </td>
                            <td> <select name="group" id="group" onChange="getBatch(this.value)" class="validate[required]">
                                  <option value="">&nbsp;&nbsp;- - -</option>
								  <option value="1"<?php if($group==1){echo "Selected";}?>>BBA</option>
								  <option value="2"<?php if($group==2){echo "Selected";}?>>MBA</option>
								  <option value="3"<?php if($group==3){echo "Selected";}?>>EMBA</option>
								  <option value="4"<?php if($group==4){echo "Selected";}?>>Fellow</option>
								  <option value="5"<?php if($group==5){echo "Selected";}?>>Honorary</option>
								  <option value="6"<?php if($group==6){echo "Selected";}?>>Associate</option>
								</select>
                            </td>
                            
                            <td></td><td></td><td></td>
                                
                            <td> Batch </td>
                            <td> 
									  <div id="statediv"><select name="batch" id="batch" class="validate[required]">
										<option>---</option>
											</select></div>
                            </td>
                            
                            <td></td><td></td><td></td>
                            
                            <td> Gender </td>
                            <td> 
								<select name="gender" id="gender" class="validate[required]">
								  <option value="">&nbsp;&nbsp;- - -</option>
								  <option value="1"<?php if($_GET['gender']==1){echo "Selected";}?>>Male</option>
								  <option value="2"<?php if($_GET['gender']==2){echo "Selected";}?>>Female</option>
								</select>
                            </td>
                        </tr>
                        </table>
                        
                        <table cellspacing="20" cellpadding="10">              
                        <tr>
                            <td> Name </td>
                            <td colspan="2">
								<input type="text" class="validate[required] text-input textstyle" name="full_name" id="full_name" size="40" value="<?php echo $_GET['full_name'];?>" /> 
							</td>
                                
                            <td> Nickname </td>
                            <td colspan="2"> 
								<input type="text" name="nick_name" class="validate[required] text-input textstyle" id="nick_name" value="<?php echo $_GET['nick_name']?>" /> 
							</td>
                        </tr>
                        
                        <tr>
                            <td> Cell No </td>
                            <td colspan="2">
								<input type="text" name="cell_phone" class="validate[required,custom[phone]] text-input textstyle" id="cell_phone" value="<?php echo $_GET['cell_phone'];?>" /> 
							</td>
                                
                            <td> Alternate Cell No. </td>
                            <td colspan="2"> 
								<input type="text" name="cell_phone1" id="cell_phone1" value="<?php echo $_GET['cell_phone1'];?>"  class="textstyle" />
							</td>
                        </tr>
                        
                        <tr>
                            <td> Email </td>
                            <td colspan="2"><input type="text" name="email" id="email" class="validate[required,custom[email]] text-input textstyle" value="<?php echo $_GET['email'];?>" /> </td>
                                
                            <td> Confirm mail </td>
                            <td colspan="2"> 
								<input class="validate[required,equals[email]] text-input" type="text" name="password2" id="password2" />
							<!-----
								<input type="text" name="conemail" id="conemail" class="textstyle"/>
							-----> 
							</td>
                        </tr>
                        
                        <tr>
                            <td valign="top"> Postal Address </td>
                            <td colspan="2">
								<textarea name="address" id="address" class="validate[required] text-input textstyle" class="textstyle"><?php echo $_GET['address'];?></textarea> 
							</td>                                
                        </tr>
						<tr>
							<td colspan="6"><input type="submit" value="submit" /></td>
						</tr>
                    </table>
                </form>
            </div><!-- end of container -->
            
            
        
        </div>
        <div id="after_middle_curvy_bottom"></div>
    </div><!-- end of after_middle_black_body -->
    
</div><!-- end of main_div -->
</body>
</html>
